/**
 * createUser:JAVA_TOM
 * FileName: redisServerImpl
 * Author:   14562
 * Date:     2019/1/14 18:29
 * Description:
 */
package com.javatom.zwl.stream_redis.redis;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.data.redis.core.RedisTemplate;
import org.springframework.data.redis.core.StringRedisTemplate;
import org.springframework.data.redis.core.ValueOperations;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;

@Service
public class redisServerImpl implements redisServer {

    @Autowired
    StringRedisTemplate stringRedisTemplate;

    @Resource( name = "stringRedisTemplate")
     ValueOperations<String, String> valOpsStr;

     @Autowired
     RedisTemplate<Object, Object> redisTemplate;

    @Resource(name = "redisTemplate")
    ValueOperations<Object, Object> valOpsObj;

    @Override
    public void set(String key, String value) {
         valOpsStr.set(key,value);
    }

    @Override
    public Object get(String key) {
        return valOpsStr.get(key);
    }

    @Override
    public void set(String key, String value, Integer time) {
        valOpsStr.set(key,value,time);
    }
}
